***** RUN DO_MASTER.do ***** do "$Do_files\DO_MASTER.do"

global program "Main_Table3"
cap log close
cap log using "$Log_files\log_$program$today", replace

**** REPLICATION OF TABLE 3 ****

clear all
set mem 2g
set more off

// Import data

use $Data\data_news_voting, clear

// Get controls

global ctrl_base	"sh_lde lpop_A sh_F sh_F_new sh_cspsup sh_sec sh_ter lmean_reink lmean_reink2 charact_altitude charact_altitude_std sh_active sh_young sh_prot sh_M com_property mk" // 
global ctrl_plus	"mean_votation lcrSR_F_N"

global fe			"charact_agglo"
global fe_iv		"I_charact_agglo_*"
global cluster		"charact_agglo"

// Column 1

reghdfe oui_false instr_dev_mk /// 
	$ctrl_plus ///	
	$ctrl_base ///
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster)	keepsing	
estimates store RF_false

// Column 2

reghdfe oui_2007 instr_dev_mk /// 
	$ctrl_plus ///	
	$ctrl_base ///
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster)	keepsing	
estimates store RF_false_2007

// Column 3

cap drop instr_dev_mk
g instr_dev_mk=instr_dev_3m
reghdfe oui instr_dev_mk $ctrl_plus $ctrl_base ///
	if sample_hq00dstr==1, ///
	vce(cluster $cluster) absorb($fe) keepsing	
estimates store RF_3m

// Column 4

cap drop instr_dev_mk
g instr_dev_mk=instr_dev_3f
reghdfe oui instr_dev_mk $ctrl_plus $ctrl_base ///
	if sample_hq00dstr==1, ///
	vce(cluster $cluster) absorb($fe) keepsing	
estimates store RF_3f

// Column 5
		
cap drop instr_dev_mk1
g instr_dev_mk1=instr_dev_mkt2
reghdfe oui instr_dev_mk1 /// 		
	$ctrl_plus ///
	$ctrl_base /// 
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster)	keepsing
estimates store RF_mkt2

// Column 6
		
cap drop instr_dev_mk1
g instr_dev_mk1=instr_dev_mkf2
reghdfe oui instr_dev_mk1 /// 		
	$ctrl_plus ///
	$ctrl_base /// 
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster) keepsing	
estimates store RF_mkf2

// Column 7

cap drop instr_dev_mk1
g instr_dev_mk1=instr_dev_mkt1
reghdfe oui instr_dev_mk1 /// 		
	$ctrl_plus ///
	$ctrl_base /// 
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster)	keepsing
estimates store RF_mkt1

// Column 8

cap drop instr_dev_mk1
g instr_dev_mk1=instr_dev_mkf1
reghdfe oui instr_dev_mk1 /// 		
	$ctrl_plus ///
	$ctrl_base /// 
	if sample_hq00dstr==1, ///
	absorb($fe) cluster($cluster)	keepsing
estimates store RF_mkf1

// Labels

la var endog_mk 		"Crime News Exposure ($\mathtt{CNE}$)"
la var instr_dev_mk 	"$ \mathtt{\Delta HQC} $ (HQ $ \mathtt{CPD} $ Deviation)"
la var lcrSR_F_N 		"\\ $ \mathtt{CPD} $ (Local Crime Prop. Diff.)"
la var mean_votation 	"\\ Past Votes Outcomes"
la var instr_dev_mk1 	"\\ Distance based $ \mathtt{\Delta HQC} $ "

// Table

estout RF_false RF_false_2007 RF_3m RF_3f RF_mkt2 RF_mkf2 RF_mkt1 RF_mkf1 ///
	using "$Results\\$program.tex", replace style(tex) type label	///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  ///
	stats(N r2_a, lab("Observations" "Adjusted $ R^2 $") fmt(0 3)) /// 
	collabels(none) ///
	mlabels(, span none prefix(\multicolumn{@span}{c}{) suffix(})) ///
	msign(--) starlevels($^c$ .1 $^b$ .05 $^a$ .01) ///
	keep(lcrSR_F_N mean_votation instr_dev_mk instr_dev_mk1) /// 
	order(instr_dev_mk instr_dev_mk1 mean_votation lcrSR_F_N) ///
	title(News and voting: Falsification exercises) ///	
	prehead( /// 
	"\begin{table}[!h]" ///
	"\begin{center}" ///
	"\begin{threeparttable}" ///
	"\begin{scriptsize}" ///
	"\caption{@title\label{$program}}" ///
	"\begin{tabular*}{\columnwidth}{@{\extracolsep{\stretch{1}}}l*{@M}{c}@{}}" ///
	"\hline" "\hline" ///	
	"\\" ///
	"Falsification		&\multicolumn{2}{c}{Outcome}									&\multicolumn{2}{c}{Time frame}									&\multicolumn{2}{c}{Readership}								&\multicolumn{2}{c}{Language} \\" ///
	"					\cmidrule(lr){2-3}												\cmidrule(lr){4-5}												\cmidrule(lr){6-7} 											\cmidrule(lr){8-9}" ///
	"					&\multicolumn{1}{c}{Preceding} &\multicolumn{1}{c}{2007}		&\multicolumn{1}{c}{3 months}	&\multicolumn{1}{c}{3 months}	&\multicolumn{1}{c}{Read}		&\multicolumn{1}{c}{Read}	&\multicolumn{1}{c}{Spoken}		&\multicolumn{1}{c}{Spoken} \\" ///
	"					&\multicolumn{1}{c}{referendum} &\multicolumn{1}{c}{election}	&\multicolumn{1}{c}{before} 	&\multicolumn{1}{c}{after}		&\multicolumn{1}{c}{yes}		&\multicolumn{1}{c}{no}		&\multicolumn{1}{c}{yes}		&\multicolumn{1}{c}{no} \\" ///
	"					\cmidrule(lr){2-2}				\cmidrule(lr){3-3} 		 		\cmidrule(lr){4-4}				\cmidrule(lr){5-5}				\cmidrule(lr){6-6}				\cmidrule(lr){7-7}			\cmidrule(lr){8-8}				\cmidrule(lr){9-9}" ///
	"					&\multicolumn{1}{c}{(1)} 		&\multicolumn{1}{c}{(2)}  		&\multicolumn{1}{c}{(3)}		&\multicolumn{1}{c}{(4)} 		&\multicolumn{1}{c}{(5)}  		&\multicolumn{1}{c}{(6)} 	&\multicolumn{1}{c}{(7)}  		&\multicolumn{1}{c}{(8)}\\") ///
	posthead("\hline" ///
	"\\") ///
	prefoot("\\" ///
	"\hline") ///
	postfoot("\hline" "\hline" ///
	"\end{tabular*}" /// 
	"\end{scriptsize}" ///
	"\begin{tablenotes}[normal,flushleft]" ///
	"\begin{scriptsize}" ///
	"\item \emph{Notes}:" /// 
	"The unit of observation is a municipality. " /// 
	"Standard errors clustered at agglomeration level in parentheses. " /// 
	"{$^c$} significant at 10\%; {$^b$} significant at 5\%; {$^a$} significant at 1\%. " ///
	"Column (1) shows the reduced-form estimates of an estimation where the outcome is the vote share in favor of the \textit{Abolition of the general popular initiative} " ///
	"that took place in the referendum preceding the Minaret Ban vote (Sep 27, 2009). " ///
	"Column (2) shows the reduced-form estimation when using the 2007 federal election vote share of parties that recommended voting in favor of the Minaret Ban as the outcome. " ///
	"Columns (3) and (4) present instrument falsifications by estimating the baseline only focusing on the 3 months preceding the referendum (true) and the three months after (false). " ///
	"Columns (5) to (8) present the estimates of the readership and language reduced-form falsifications. " ///
	"In Column (5) we replicate the reduced-form estimation of Table \ref{Main_Table2} focusing on the newspapers that are read in the municipality; in Column (6) we keep only newspapers not read in a municipality. " ///
	"In Column (7) we only keep outlets edited in the language spoken in the municipality; in Column (8) we focus on newspapers that are written in a language not spoken in the municipality. " ///
	"Since the instrument takes the value 0 once a newspaper is not read, " ///
	"we also instrument for market shares by weighting each outlet by the relative distance between the (voting) municipality and the nearest headquarter municipality of that newspaper. " ///
	"All regressions include the full vector of controls of Table \ref{Main_Table2}. " ///
	"\end{scriptsize}" ///
	"\end{tablenotes}" ///
	"\end{threeparttable}" ///
	"\end{center}" ///
	"\end{table}") //

cap log close
